package lambda;

import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class LambdaDemo {
    public static void main(String[] args) {

        Random random = new Random();
        List<Integer> list = new ArrayList<>();
        for (int i = 0;i<10;i++) {
            list.add(random.nextInt(100));
        }
        System.out.println(list);
//        Collections.sort(list,(o1,o2)->o1-o2);
        list.sort((o1,o2)->o1-o2);
        System.out.println(list);


//        File dir = new File("src/main/java/lambda");
//        File[] subs = dir.listFiles((file) -> file.getName().contains("L"));
//        for (File sub:subs) {
//            System.out.println(sub.getName());
//        }
    }
}
